import axios from 'axios';

export const baseUrl = "http://localhost:8000"
// 登录
export const login = params => {
  return axios.post(baseUrl + `/user/login`, params)
};
//登出
export const logOut = params => {
  return axios.post(baseUrl + "/user/logout", params)
};
//获取用户首页数据
export const getUserIndex = params => {
  return axios.get(baseUrl + `/user/index`, {params: params})
};

//示例接口 get 
// export const fsdfsdfsdf = params => {
//   return axios.get(baseUrl + `。。。。。`, {params: params})
// };
// //示例接口 post
// export const asdasdasdas = params => {
//   return axios.post(baseUrl + "。。。。。。。", params)
// };



//获取用户信息
export const getUserInfo = params => {
  return axios.get(baseUrl + `/user/info`, {params: params})
};
//获取项目列表
export const getPrjList = params => {
  return axios.get(baseUrl + `/project/list`, {params: params})
};
export const getPerformancesOfProject = params => {
  return axios.get(baseUrl + `/project/list/user`, {params: params})
};
export const getPerformanceList = params => {
  return axios.get(baseUrl + `/performance/get/project`, {params: params})
};
export const getAchievementList = params => {
  return axios.get(baseUrl + `/achievement/get/project`, {params: params})
};
export const getArgumentListDetail = params => {
  return axios.get(baseUrl + `/argument/list/detail`, {params: params})
};
export const getArgumentListByProject = params => {
  return axios.get(baseUrl + `/argument/get/project`, {params: params})
};
//添加项目
export const performanceSave = params => {
  return axios.post(baseUrl + `/performance/save`, params)
};
//添加项目
export const achievementSave = params => {
  return axios.post(baseUrl + `/achievement/save`, params)
};
//添加项目
export const projectSave = params => {
  return axios.post(baseUrl + `/project/save`, params)
};
export const getIndexData = params => {
  return axios.get(baseUrl + `/api/indexTab`, {params: params})
};
//获取用户列表
export const getUserList = params => {
  return axios.get(baseUrl + `/user/list`, {params: params})
};
//获取所有用户列表
export const getAllUser = params => {
  return axios.get(baseUrl + `/user/all/list`, {params: params})
};
//修改用户信息
export const updateUser = params => {
  return axios.post(baseUrl + `/user/save`, params);
};

export const deletePrj = params => {
  return axios.post(baseUrl + `/project/delete`, params)
};
export const getPrjPerformance = params => {
  return axios.get(baseUrl + `/performance/get/project`, {params: params})
};
export const getPrjAchievement = params => {
  return axios.get(baseUrl + `/achievement/get/project`, {params: params})
};
//论证编制
export const addArgument = params => {
  return axios.post(baseUrl + `/argument/save`, params)
};
export const getArgumentList = params => {
  return axios.get(baseUrl + `/argument/list`, {params: params})
};
//公共服务
export const getService = params => {
  return axios.get(baseUrl + `/service/get/user`, {params: params})
};
export const addService = params => {
  return axios.post(baseUrl + `/service/save`, params)
};
//科研成果
export const getResearch = params => {
  return axios.get(baseUrl + `/research/get/user`, {params: params})
};
export const addResearch = params => {
  return axios.post(baseUrl + `/research/save`, params)
};
//
export const addPersonalInput = params => {
  return axios.post(baseUrl + `/user/input/save`, params)
}
